package speed2010.util;

import speed2010.middleware.comunicacao.Address;

public class ParAddressTimeESsm {
	//private Address addressNodeEntrante = null;
	private Address addressNodePD = null;
	private long time = -1;
	private double ssm = -1;

	public ParAddressTimeESsm(/*Address addressNode, */Address addressNodePD,
			double ssm) {
		//this.addressNodeEntrante = addressNode;
		this.addressNodePD = addressNodePD;
		this.time = System.currentTimeMillis();
		this.ssm = ssm;
	}

//	public Address getAddressEntrante() {
//		return addressNodeEntrante;
//	}

	public Address getAddressNodePD() {
		return addressNodePD;
	}

	@Override
	public boolean equals(Object obj) {
		if (/*this.addressNodeEntrante
				.equals(((ParAddressTimeESsm) obj).addressNodeEntrante)
				&& */this.addressNodePD
						.equals(((ParAddressTimeESsm) obj).addressNodePD)
				&& ssm == ((ParAddressTimeESsm) obj).ssm) {
			return true;
		} else {
			return false;
		}
	}

//	public void setAddressNodeEntrante(Address addressNode) {
//		this.addressNodeEntrante = addressNode;
//	}

	public void setAddressNodePD(Address addressNode) {
		this.addressNodePD = addressNode;
	}

	public double getSsm() {
		return ssm;
	}

	public void setSsm(double ssm) {
		this.ssm = ssm;
	}

	@Override
	public String toString() {
		return /*"Address entrante: "
				+ this.addressNodeEntrante.toStringReduzido()
				+ */" - AddressNodePD: " + this.addressNodePD.toStringReduzido() + " - SSM"
				+ this.ssm + " - " + Util.formataEmHora(this.time);
	}

	public long getTime() {
		return this.time;
	}
}
